package com.dayu.design.创建型.抽象工厂模式;

import com.dayu.design.common.ActionEnum;
import com.dayu.design.common.ShapeEnum;
import com.dayu.design.创建型.简单工厂模式.Shape;

/**
 * @author dayu
 * @create 2023-12-01 14:17
 */
public class ActionFactory extends AbstractFactory{

    @Override
    protected Action getAction(ActionEnum action) {
        try {
            return action.getClazz().newInstance();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return null;
    }
}
